package addon.w3.mdx.com;

import java.io.IOException;

import addon.w3.mdx.LEDataInputStream;
import addon.w3.mdx.MDXException;
import addon.w3.mdx.MDXParentCOM;

/**
 * SEQS						// [Sequences] (v13: +8 bytes?)
	long	nbytes;
	struct {
		ASCII	Name;			(0x50 bytes)
		long	IntStart, IntEnd;
		float	MoveSpeed;
		long	NoLooping;		(0:loop; 1:no loop)
		float	Rarity;
		long	???;			(0)
		float	BoundsRadius;
		float	MinExtx, MinExty, MinExtz;
		float	MaxExtx, MaxExty, MaxExtz;
	} sequences[nseqs];
 * @author madjk
 *
 */
public class MDXSequence extends MDXParentCOM {
	int length = -1;
	public MDXSequenceCOM seqs[] = null;
	
	public String getTag() {
		return "SEQS";
	}
	
	public void _decode(LEDataInputStream ins) throws IOException, MDXException {
		length = ins.readInt();
		seqs = new MDXSequenceCOM[length/(102+30)]; //(102:sequence com's length, 30:donno)
		for(int i=0;i<seqs.length;i++) {
			seqs[i] = new MDXSequenceCOM();
			seqs[i].decode(ins);
		}
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("TAG : "+getTag());
		sb.append("\n\tILEN : "+length);
		if(seqs != null && seqs.length > 0) sb.append("\n\tSEQS[] : "+seqs.length);
		return sb.toString();
	}

	@Override
	public boolean isImplicitTag() {
		// TODO Auto-generated method stub
		return false;
	}
}
